1. Field of the Invention
The present invention relates to an image compression coding apparatus and method for compressing and coding input image data such as a dynamic image.
2. Description of the Background Art
Currently, an MPEG 2 has been a core technique of AV equipment as an international standard for an image compression technology. Various image compressing methods such as TV telephone/conference H. 261 (a recommendation number determined by ITU-T) or an MPEG (Moving Picture Experts Group) 1 which is an antecedent of the MPEG 2 as well as the MPEG 2 have been investigated and standardized.
An image compression coding apparatus using these image compression methods has an output buffer having a comparatively large capacity in an output stage of image compression data output from an image compressor. The output buffer is provided to absorb a difference in a data transfer rate made between the image compression coding apparatus and output side means of a communication path connected to the output side thereof.
For example, in the case in which a digital telephone line is connected as the output side means to the image compression coding apparatus for a TV telephone, a data transfer rate of the telephone line is always 64 kbps, for example, and a data volume of image compression data per unit time which are generated by the image compression coding apparatus is always changed depending on the complexity of the input image data. For example, the image compression data for one screen obtained every {fraction (1/30)} second are varied depending on the data volume of the input image data.
More specifically, in the case in which the input image data define complicated image contents, the data volume of the image compression data themselves is also increased so that the data transfer rate of the image compression data is increased. To the contrary, in the case in which the input image data define simple image contents, the data volume of the image compression data themselves is reduced so that the data transfer rate of the image compression data is decreased.
At this time, the image compressor for outputting the image compression data is controlled such that a mean data transfer rate of output image compression data output from the image compression coding apparatus is 64 kbps. A fluctuation in the data transfer rate of the image compression data can be buffered through an output buffer provided between the image compression coding apparatus and the telephone line.
Thus, the control of the coding quantity through the image compressor which is to be carried out to average the data transfer quantity of the image compression data to a predetermined bit rate in the image compressor is referred to as “rate control”.
In the case of MP ML (Main Profile at Main Level) of the MPEG 2 standard, the output buffer has a size of 1,835 Mbit defined. However, there is a problem in that the output buffer should be fully utilized for the rate control to enhance the whole picture quality.
For example, a data volume which is as large as possible is assigned as the data volume of the image compression data to a complicated image and a data volume which is as small as possible is assigned as the data volume of the image compression data to a simple image. Consequently, the wholly average picture quality can be enhanced.
Depending on the control contents of the rate control, however, the output buffer overflows so that a part of the image compression data are lacked in some cases. For example, when complicated input image data are input continuously, the filling quantity of the output buffer (the storage quantity of unoutput image compression data) is increased so that a residual quantity is decreased. However, image compression data having a large data volume are continuously transferred to the output buffer. Therefore, there is a higher possibility that the output buffer might overflow.
FIG. 20 is a block diagram showing an example of a structure of a conventional image compression coding apparatus. As shown in FIG. 20, an image compressor 22 receives input image data S21 obtained through an image input terminal 21, compresses and codes the input image data S21 and outputs image compression data S22 to an output buffer 23.
The output buffer 23 sequentially fetches and temporarily stores the image compression data S22 and outputs the image compression data S22 as output image compression data S23 to an image data output terminal 24 by an FIFO (first-in first-out) method. The output buffer 23 is constituted by an FIFO memory for outputting input data by the FIFO method while changing a read address (an address for reading written data) and a write address (an address for newly writing data).
The output buffer 23 has a full flag terminal FF for outputting a full flag signal SF. The full flag signal SF is brought into an active state during an overflow in which the buffer filling quantity is full. The full flag signal SF is input to an interruption terminal INT of a processor 25 which will be described later.
When the full flag signal SF is brought into the active state, the processor 25 writes, to a reset register 27, a reset value indicative of reset execution for the reset register 27 through an external bus 26.
The image compressor 22 and the output buffer 23 can read the reset value stored in the reset register 27 through a reset terminal RST, respectively. In the case in which the reset value is indicative of the reset execution, a reset processing of initializing respective contents and carrying out restarting is executed.
With such a structure, when the input image data S21 defining complicated image contents are continuously input, a rate at which the image compression data S22 are to be input to the output buffer 23 exceeds a rate at which the output image compression data S23 are output from the output buffer 23. Therefore, the filling quantity of the output buffer 23 is increased. When such a state continues, the filling quantity of the output buffer 23 becomes full (overflows).
When the output buffer 23 overflows, the full flag signal SF set in the active state is output from the output buffer 23 and is given to the interruption terminal INT of the processor 25.
FIG. 21 is a flow chart showing an operation of the processor 25 which is carried out during the overflow of the output buffer 23.
As shown in FIG. 21, at Step S201, a reset value indicative of reset execution is written to the reset register 27 and a processing is ended.
Then, the image compressor 22 stops a compression processing which is being executed and executes a reset processing and restarts the compression processing for the input image data S21 newly input after the reset processing, and the output buffer 23 executes the reset processing of setting the current filling quantity to “0” (for discarding the image compression data S22 which are being stored) and buffers, by the FIFO method, the image compression data S22 newly input after the reset processing.
Thus, the conventional image compression coding apparatus executes the reset processing of the image compressor 22 and the output buffer 23 when the output buffer 23 overflows.
However, the reset processing requires a comparatively long time until a normal image compression coding processing is restarted after the reset processing. In the meantime, therefore, the input image data S21 to be input to the image compressor 22, the image compression data S22 which are being compressed by the image compressor 22 during the reset and correspond to data discarded by the reset processing, and the output image compression data S23 which are filled in the output buffer 23 during the reset in such a state that the image compression data S22 discarded by the reset processing are lacked.
As a result, there has been a problem in that the picture quality of an image to be reproduced based on the output image compression data S23 is deteriorated. For example, in the case in which one second is required before the compression coding processing is restarted after the reset processing, the image compression data S22 for one second+α (a data volume lacked in the image compressor 22 and the output buffer 23) are lacked.